import React from 'react';
// import './home.css';
import UcBanner from '../../components/uc-banner/uc-banner';
import UcCell from '../../components/uc-cell/uc-cell'
import { queryHome } from '../../services/new'
import { withRouter } from 'react-router';
// 插件库
import NavHeade from '../../components/Nav_header';
// import NavTabs from '../../components/Nav_Tabs'

export default class Home extends React.Component {
    state = {
        home: []
    };
    async componentDidMount() {
        let { data: home } = await queryHome();
        this.setState({ home })
    }
    render() {
        let { home } = this.state
        return (
            <div>
                <NavHeade />
                {/* <NavTabs /> */}
                <UcBanner />

                {
                    home.map((item, index) =>
                        <UcCell
                            key={item._id}
                            title={item.title}
                            label={item.des}
                            index={index}
                            to={`/detail/${item._id}?collectionName=home`}
                        />
                    )
                }
            </div>
        )
    }
}